﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FuckData.Model;
using FuckCore.DAO;

namespace FuckData.DAO
{
    public class CategoryDAO:BaseDAO<GoEasyEntities,tbl_Category>
    {
        /// <summary>
        /// Create by DucND
        /// Datecreate 17/01/2014
        /// Get list of category model
        /// </summary>
        /// <returns></returns>
        public List<CategoryModel> GetListCategory()
        {
            var Result = from cat in ObjectContext.tbl_Category
                         where cat.Status == 1 && cat.CategoryType == 1
                         select new CategoryModel {
                             ID=cat.ID,
                             CategoryName=cat.CategoryName,
                             CategoryType=cat.CategoryType,
                             Description=cat.Description,
                             Status=cat.Status
                         };
            return Result.Count() > 0 ? Result.ToList() : null;
        }
    }
}
